package in.waffl.fairycake;

import java.awt.Graphics2D;

public class Angel extends Projectile {
	public Angel(Character character, int deadImage, final Canvas canvas) {
		super(character.getX(), character.getY(), character.getWidth(), character.getHeight());
		setGravity(0);
		setVspeed(-4);
		this.setImageIndex(deadImage);
		setSprite(character.getSprite());
		this.drawable = new Drawable() {
			@Override
			public void draw(Graphics2D g) {
				getSprite().draw(g, canvas, getX(), getY()-29, getImageIndex());
			}
		};
		drawable.depth = -2;
		canvas.addDrawable(drawable);
	}

	@Override
	protected void projectilePoll(PollingThread p) {
		if (getY() < 0) {
			this.destroy();
		}
	}
}
